package com.ttl.bc.report.purchasing;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import org.apache.struts.actions.DispatchAction;



public class PurchasingReportAction extends DispatchAction {
	
	public ActionForward report(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) 
			throws Exception {
		
		String param = (String)request.getParameter("param");

		if(param==null) {
			return mapping.findForward("purchasing_main");
		}
		
		if(param.equalsIgnoreCase("taxBuy")) {
			new PurchasingReportBO().getTaxBuyReport(form, request, response, getServlet());			
		}else if(param.equalsIgnoreCase("materialsInStock")) {
			new PurchasingReportBO().getMaterialsInStockReport(form, request, response, getServlet());			
		}else if(param.equalsIgnoreCase("purchasingMaterials")) {
			new PurchasingReportBO().getPurchasingMaterialsReport(form, request, response, getServlet());			
		}else if(param.equalsIgnoreCase("dyestuffsChemicals")) {
			new PurchasingReportBO().getDyestuffsChemicalsReport(form, request, response, getServlet());			
		}else if(param.equalsIgnoreCase("purchasing_dept_project")) {
			new PurchasingReportBO().getPurchasingDeptProjectReport(form, request, response, getServlet());			
		}else if(param.equalsIgnoreCase("purchasing_dept_project_summary")) {
			new PurchasingReportBO().getPurchasingDeptProjectSummaryReport(form, request, response, getServlet());			
		}else if(param.equalsIgnoreCase("purchasing_dept_project_waiting")) {
			new PurchasingReportBO().getPurchasingDeptProjectWaitingReport(form, request, response, getServlet());			
		}		
						
		return null;					
	}		
}
